package com.tk.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.tk.entity.Hero;
import com.tk.service.HeroService;
import com.tk.service.StatisticsService;
import com.tk.service.impl.HeroServiceImpl;
import com.tk.service.impl.StatisticsServiceImpl;

/**
 * Servlet implementation class killServlet
 */
public class killServlet extends HttpServlet {
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp)
		throws ServletException, IOException{
		req.setCharacterEncoding("UTF-8");
		resp.setCharacterEncoding("UTF-8");
		String hid = req.getParameter("hid");
		String team = req.getParameter("team");
		System.out.println(team);
		StatisticsService sSer = new StatisticsServiceImpl();
		sSer.kill(team);
		HeroService hSer = new HeroServiceImpl();
		hSer.kill(hid);
		req.getRequestDispatcher("findheroServlet?tog=kill").forward(req, resp);
	}
	
	
}
